package com.easybbs.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.easybbs.controller.base.ABaseController;
import com.easybbs.entity.po.ForumBoard;
import com.easybbs.entity.vo.ResponseVO;
import com.easybbs.service.ForumBoardService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: yudaxian
 * @Description: TODO
 * @DateTime: 2024/10/21 22:55
 **/
@RestController
@Api(tags = "论坛版块管理")
@RequestMapping("/board")
public class ForumBoardController extends ABaseController {

    @Resource
    private ForumBoardService forumBoardService;

    /**
     * 加载论坛版块列表
     * @return
     */
    @ApiOperation(value = "加载论坛版块列表")
    @SaCheckLogin
    @PostMapping("/loadBoard")
    public ResponseVO loadBoard() {
        List<ForumBoard> boardList = forumBoardService.getBoardTree(null);
        return getSuccessResponseVO(boardList);
    }


}
